Sunday, May 03, 2009

Java 6 and EJB 3.1

I'm a regular member of the NovaJUG in the DC area, but I wasn't sure I wanted to go to the Java EE6/EJB 3.1 session. We had a similar session a month or two before, but I had heard Reza Rahman speak before, and I thought it was worth the few hours. And I have to say that I am excited about Web Beans and to see Java start to shed the bloat and boilerplate code and follow down the path that Spring and others paved years ago. This means that you no longer have to fight people who claim "but we need the stability and performance of J2EE" Web Beans help show that it doesn't need to be hard to be robust, and proves that Sun (and Microsoft with their bloated COM/DCOM) had it wrong. Web Beans will help the rest get back to business, and hopefully reduce the repository size and number of lines of code that have to be maintained in the future. After all, do you really seen a SessionHome, a SessionRemote, and another file filled with boilerplate code to get your business logic done?

Okay, off of the soap box. I'm really behind in my blog entries, so I'm basically going to share with you the notes that I took at that meeting. I'm sure that Reza's presentation is online, and I'll track it down and update this entry with its location.

Java EE 6/EJB 3.1
Presenter: Reza Rahman
He has a series of EJB 3.1 article on theserverside.com

Pruning, Profiles, Innovation
  • WebBeans
  • JSF 2.0
  • EJB 3.1
  • JPA 2.0
  • Servlet 3.0
  • JAX-RS 1.1
  • deprecating JAX-RPC (in favor of JAX-WS)
  • JAXR being deprecated
  • Deployment (including EAR versus WAR)

    Profiles
    Web Profile planned as only profile for now
    Will use EJB 3.1 Lite
    Issues of whether or not Web Beans is going to be included. Some issues of cross-cutting concerns,
    and IBM has stepped up and said that there are issues with JSR-299 not sticking to its spec.

    Web Beans 1.0
    stateful, conversations, type-safe DI, enhancements to model, decorators, annotations meta-programming

    Interceptors -
    @Audited annotation can represent and Interceptor that is used for logging
    Interceptor is in the Audited interface and annotated as such:

    @Audited @Interceptor


    JSF 2.0
  • RAILS_ENV style development stage (dev, test, prod)
  • pub/sub
  • All of faces-config.xml can be done in annotations now.

    Managing of other resources (including versioning): CSS, Internationalization

    [META-INF]/resources
    [localPrefix]/[libraryName/][libraryVersion/]resourceName[/resourceVersion]

    Resource resource = FaceContext.getApplication().getResourceHandler().createResource (resourceName[,libraryName]);

    // and then use it by name in annotation
    @ResourceDependency(name="style.css", library="actionbazaar")
    public class HeaderTabs extends UIComponentBase

    EJB 3.1
    Session Bean interfaces optional
    Singleton Beans

    cron-style timers (still issues with software down when action is supposed to take place)
    @schedule annotation (second="", /* cron style */ minute, hour, dayOfMonth, month, year)
    can deal with pausing/canceling of tasks

    async bean invocation
    WAR packaging when an WAR was required in the past; easier for dynamic language packaging
    Java SE support
    Standardized the Global JNDI naming across app servers
    EJB Lite

    Asynchronous

    JPA 2.0
    Enhanced mapping
    Collections, maps, and ordered lists,
  • lookup tables handled in the class instead of an embedded Entity
    Unidirectional one-to-many and many-to-many mappings
  • JoinColumn must be defined on the "many" side now, but the @OneToMany annotation can be added now.
    join tables
    first result, max result, unwrapping
    CASE, NULLIF, COALWSCE
    Locking, JDBC
    Criteria API
    Second Level Caching
    Pessimistic locking


    Servlet 3.0
    annotations from ground up
    optional web.xml
    intelligent defaults (convention over configuration)
    Modular web.xml fragments in framework library jars (many web.xmls in various jar files)
  • allows better reuse
    Programattic addition of Servlets, Filters, and Listeners through the ServletContect
    Asynch processing support in Servlets

  • 0 Comments:

    Post a Comment

    << Home